/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package reamodel.util;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

import reamodel.*;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see reamodel.ReamodelPackage
 * @generated
 */
public class ReamodelSwitch<T> {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static ReamodelPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReamodelSwitch() {
		if (modelPackage == null) {
			modelPackage = ReamodelPackage.eINSTANCE;
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	public T doSwitch(EObject theEObject) {
		return doSwitch(theEObject.eClass(), theEObject);
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(EClass theEClass, EObject theEObject) {
		if (theEClass.eContainer() == modelPackage) {
			return doSwitch(theEClass.getClassifierID(), theEObject);
		}
		else {
			List<EClass> eSuperTypes = theEClass.getESuperTypes();
			return
				eSuperTypes.isEmpty() ?
					defaultCase(theEObject) :
					doSwitch(eSuperTypes.get(0), theEObject);
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case ReamodelPackage.REA_MODEL: {
				REAModel reaModel = (REAModel)theEObject;
				T result = caseREAModel(reaModel);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_RESOURCE_TYPE: {
				EconomicResourceType economicResourceType = (EconomicResourceType)theEObject;
				T result = caseEconomicResourceType(economicResourceType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_AGENT_TYPE: {
				EconomicAgentType economicAgentType = (EconomicAgentType)theEObject;
				T result = caseEconomicAgentType(economicAgentType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_EVENT_TYPE: {
				EconomicEventType economicEventType = (EconomicEventType)theEObject;
				T result = caseEconomicEventType(economicEventType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE: {
				IncrementEconomicEventType incrementEconomicEventType = (IncrementEconomicEventType)theEObject;
				T result = caseIncrementEconomicEventType(incrementEconomicEventType);
				if (result == null) result = caseEconomicEventType(incrementEconomicEventType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.DECREMENT_ECONOMIC_EVENT_TYPE: {
				DecrementEconomicEventType decrementEconomicEventType = (DecrementEconomicEventType)theEObject;
				T result = caseDecrementEconomicEventType(decrementEconomicEventType);
				if (result == null) result = caseEconomicEventType(decrementEconomicEventType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_RESOURCE: {
				EconomicResource economicResource = (EconomicResource)theEObject;
				T result = caseEconomicResource(economicResource);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_AGENT: {
				EconomicAgent economicAgent = (EconomicAgent)theEObject;
				T result = caseEconomicAgent(economicAgent);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.ECONOMIC_EVENT: {
				EconomicEvent economicEvent = (EconomicEvent)theEObject;
				T result = caseEconomicEvent(economicEvent);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT: {
				IncrementEconomicEvent incrementEconomicEvent = (IncrementEconomicEvent)theEObject;
				T result = caseIncrementEconomicEvent(incrementEconomicEvent);
				if (result == null) result = caseEconomicEvent(incrementEconomicEvent);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.DECREMENT_ECONOMIC_EVENT: {
				DecrementEconomicEvent decrementEconomicEvent = (DecrementEconomicEvent)theEObject;
				T result = caseDecrementEconomicEvent(decrementEconomicEvent);
				if (result == null) result = caseEconomicEvent(decrementEconomicEvent);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.COMMITMENT: {
				Commitment commitment = (Commitment)theEObject;
				T result = caseCommitment(commitment);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.INCREMENT_COMMITMENT: {
				IncrementCommitment incrementCommitment = (IncrementCommitment)theEObject;
				T result = caseIncrementCommitment(incrementCommitment);
				if (result == null) result = caseCommitment(incrementCommitment);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.DECREMENT_COMMITMENT: {
				DecrementCommitment decrementCommitment = (DecrementCommitment)theEObject;
				T result = caseDecrementCommitment(decrementCommitment);
				if (result == null) result = caseCommitment(decrementCommitment);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.PARTICIPATION: {
				Participation participation = (Participation)theEObject;
				T result = caseParticipation(participation);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.RECEIVE_PARTICIPATION: {
				ReceiveParticipation receiveParticipation = (ReceiveParticipation)theEObject;
				T result = caseReceiveParticipation(receiveParticipation);
				if (result == null) result = caseParticipation(receiveParticipation);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.PROVIDE_PARTICIPATION: {
				ProvideParticipation provideParticipation = (ProvideParticipation)theEObject;
				T result = caseProvideParticipation(provideParticipation);
				if (result == null) result = caseParticipation(provideParticipation);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.STOCKFLOW: {
				Stockflow stockflow = (Stockflow)theEObject;
				T result = caseStockflow(stockflow);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.INFLOW: {
				Inflow inflow = (Inflow)theEObject;
				T result = caseInflow(inflow);
				if (result == null) result = caseStockflow(inflow);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.OUTFLOW: {
				Outflow outflow = (Outflow)theEObject;
				T result = caseOutflow(outflow);
				if (result == null) result = caseStockflow(outflow);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.STOCKFLOW_TYPE: {
				StockflowType stockflowType = (StockflowType)theEObject;
				T result = caseStockflowType(stockflowType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.INFLOW_TYPE: {
				InflowType inflowType = (InflowType)theEObject;
				T result = caseInflowType(inflowType);
				if (result == null) result = caseStockflowType(inflowType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ReamodelPackage.OUTFLOW_TYPE: {
				OutflowType outflowType = (OutflowType)theEObject;
				T result = caseOutflowType(outflowType);
				if (result == null) result = caseStockflowType(outflowType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>REA Model</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>REA Model</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseREAModel(REAModel object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Resource Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Resource Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicResourceType(EconomicResourceType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Agent Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Agent Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicAgentType(EconomicAgentType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Event Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Event Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicEventType(EconomicEventType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Increment Economic Event Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Increment Economic Event Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIncrementEconomicEventType(IncrementEconomicEventType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Decrement Economic Event Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Decrement Economic Event Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseDecrementEconomicEventType(DecrementEconomicEventType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Resource</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Resource</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicResource(EconomicResource object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Agent</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Agent</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicAgent(EconomicAgent object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Economic Event</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Economic Event</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEconomicEvent(EconomicEvent object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Increment Economic Event</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Increment Economic Event</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIncrementEconomicEvent(IncrementEconomicEvent object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Decrement Economic Event</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Decrement Economic Event</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseDecrementEconomicEvent(DecrementEconomicEvent object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Commitment</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Commitment</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCommitment(Commitment object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Increment Commitment</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Increment Commitment</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIncrementCommitment(IncrementCommitment object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Decrement Commitment</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Decrement Commitment</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseDecrementCommitment(DecrementCommitment object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Participation</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Participation</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseParticipation(Participation object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Receive Participation</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Receive Participation</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseReceiveParticipation(ReceiveParticipation object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Provide Participation</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Provide Participation</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseProvideParticipation(ProvideParticipation object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Stockflow</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Stockflow</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseStockflow(Stockflow object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Inflow</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Inflow</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseInflow(Inflow object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Outflow</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Outflow</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseOutflow(Outflow object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Stockflow Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Stockflow Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseStockflowType(StockflowType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Inflow Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Inflow Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseInflowType(InflowType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Outflow Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Outflow Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseOutflowType(OutflowType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	public T defaultCase(EObject object) {
		return null;
	}

} //ReamodelSwitch
